<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>defineProperty</title>
</head>
<body>
<script>
let obj={x:100}
let obj2={y:200}
Object.defineProperty(obj2,"x",{
  set(v) {
    obj.x=v;
  },
  get() {
    return obj.x;
  }
})
</script>
</body>
</html>
